define('components/radios/radios.tpl',['hdbr'], function(Handlebars) {
			return Handlebars.template({"1":function(container,depth0,helpers,partials,data) {
    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;

  return "        <li class=\""
    + alias4(((helper = (helper = helpers.className || (depth0 != null ? depth0.className : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"className","hash":{},"data":data}) : helper)))
    + "\">\r\n            <div "
    + ((stack1 = (helpers.ifInDisabledValue || (depth0 && depth0.ifInDisabledValue) || alias2).call(alias1,(depth0 != null ? depth0.value : depth0),{"name":"ifInDisabledValue","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
    + "\r\n                "
    + ((stack1 = (helpers.ifInDefaultValue || (depth0 && depth0.ifInDefaultValue) || alias2).call(alias1,(depth0 != null ? depth0.value : depth0),{"name":"ifInDefaultValue","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
    + " >\r\n                <input type=\"checkbox\" \r\n                    "
    + ((stack1 = (helpers.ifInDisabledValue || (depth0 && depth0.ifInDisabledValue) || alias2).call(alias1,(depth0 != null ? depth0.value : depth0),{"name":"ifInDisabledValue","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
    + " "
    + ((stack1 = (helpers.ifInDefaultValue || (depth0 && depth0.ifInDefaultValue) || alias2).call(alias1,(depth0 != null ? depth0.value : depth0),{"name":"ifInDefaultValue","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
    + " \r\n                    value=\""
    + alias4(((helper = (helper = helpers.value || (depth0 != null ? depth0.value : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"value","hash":{},"data":data}) : helper)))
    + "\" >\r\n                <ins></ins>\r\n            </div>\r\n            \r\n            <label >\r\n                "
    + alias4(((helper = (helper = helpers.label || (depth0 != null ? depth0.label : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"label","hash":{},"data":data}) : helper)))
    + "\r\n            </label>\r\n        </li>\r\n";
},"2":function(container,depth0,helpers,partials,data) {
    return "disabled=disabled class=\"disabled\"";
},"4":function(container,depth0,helpers,partials,data) {
    return "class=\"checked\"";
},"6":function(container,depth0,helpers,partials,data) {
    return "disabled=disabled";
},"8":function(container,depth0,helpers,partials,data) {
    return "checked=checked";
},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {});

  return "<div class=\"sn-radios "
    + container.escapeExpression(((helper = (helper = helpers.className || (depth0 != null ? depth0.className : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"className","hash":{},"data":data}) : helper)))
    + "\">\r\n    <ul class=\"chk-list\">\r\n"
    + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.items : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
    + "    </ul>\r\n</div>";
},"useData":true})
		});

define('lib/requirejs/css.min!components/radios/radios',[],function(){});
define('radios',[
    'jquery',
    'eventTarget',
    'hdbr',
    'components/radios/radios.tpl',
    'lib/requirejs/css.min!components/radios/radios.css'
],function ($, eventTarget, hdbr, template){
    var VERSION = '1.1.2';
    var objClass = function(options){
        //判断el的异常值：el不存在、为空string、dom原生对象
        if(options.el){
            if(options.el instanceof jQuery&&options.el.length>0){
                this.$el = options.el;
            }else if(isDOM(options.el)){
                this.$el = $(options.el);
            }else if (typeof(options.el) == 'string'&&$(options.el).length>0) {
                this.$el = $(options.el);
            }
        }else{
            this.$el = $("<div></div>");             
        }
        this.options = options;
        eventTarget.call(this);
        helpersInit.call(this);
        render.call(this);
        eventInit.call(this);
        var _self = this;
        setTimeout(function(){
            _self.trigger('initEnd');
        }, 100);
    };
    var helpersInit = function(){
        hdbr.registerHelper('ifInDisabledValue', $.proxy(function(value, options) {
        	if(this.options.disabled){
        		var disabled = $.inArray(value, this.options.disabled);
            if (disabled == 0){
//              return options.fn(this);
				return 'disabled=disabled class="disabled"';
            }else{
                return '';
            }
        	}
        },this));
        hdbr.registerHelper('ifInDefaultValue', $.proxy(function(value, options) {
            if (this.options.defaultValue){
               	var index = $.inArray(value, this.options.defaultValue.split(','));
            if (index >= 0){
//              return options.fn(this);
				return 'class="checked" checked="checked"';
            }else{
//              return options.inverse(this);
				return '';
            }
            }
        },this));
    }
    var render = function(){
        var input = 'ul>li>div>input';
        var $input = $(input) ;  
//      var template = hdb.compile(tpl);
        this.$el.html(template(this.options));
        var $input = $(input,this.$el);
        if(this.options.disabled==1){
           this.disabled();
        }
    }
    var eventInit = function(){
        this.$el.on('click','ul>li>div',$.proxy(function(e){
            itemClick.call(this,e);
            this.trigger('itemClick',e);
        },this));
    }
    var initEnd = function(){};
    var itemClick = function(e){
        var $li = $(e.target || e.currentTarget).closest('li');
        var $input = $li.find('input');
        var index = $li.index();
        var data = this.options.items[index];
        if($input.attr('disabled')){
            return false;
        }
        if($input.attr('checked')!='checked'){
            $('ul>li>div',this.$el).removeClass('checked');
            $('ul>li>div>input',this.$el).attr('checked',false);
            $input.attr('checked',true);
            $input.parent().addClass('checked');
        }else{
//          return false;
			$('ul>li>div',this.$el).removeClass('checked');
            $('ul>li>div>input',this.$el).removeAttr('checked');
        }
        var itemData = {
            label:data.label,
            value:data.value
        };
        this.trigger('change',e,itemData);
        if(data.click){
            data.click(e,itemData);
        }
    }
    $.extend(objClass.prototype,eventTarget.prototype,{
        version:VERSION,
        disabled:function(){
            var $input = $('ul>li>div>input',this.$el);
            $input.attr('disabled',true);
            $input.parent().addClass('disabled');
        },
        enable:function(){
            $('ul>li>div>input', this.$el).attr('disabled',false)
                .parent().removeClass('disabled');
        },
        get:function(){
            return $('ul>li>div>input[checked="checked"]',this.$el).val()||'';
        },
        set:function(data,e){
            var $inputChk = $('ul>li>div>input[checked="checked"]',this.$el);
            if($inputChk.val()!= data){
                var $input = $('ul>li>div>input[value="'+data+'"]',this.$el);
                if($input.length){
                    var index = $input.closest('li').index();
                    var itemData = {
                        label:this.options.items[index].label,
                        value:data
                    };
                    $inputChk.attr('checked',false);
                    $inputChk.parent().removeClass('checked');
                    $input.attr('checked',true);
                    $input.parent().addClass('checked');
                    this.trigger('change',e,itemData);
                }
            }
        },
        clear:function(){
            var $inputChk = $('ul>li>div>input[checked="checked"]',this.$el);
            if($inputChk.length){
                $inputChk.attr('checked',false);
                $inputChk.parent().removeClass('checked');
            }
        },
        destroy:function(){
            this.$el.remove();
        }
    });
    //解决ie下console.log()报错问题
    window.console = window.console || (function(){
        var c = {};
        c.log = c.warn = c.debug = c.info = c.error = c.time = c.dir = c.profile = c.clear = c.exception = c.trace = c.assert = function(){};
        return c;
    })();
    // 判断是否为原生DOM
    var isDOM = function(obj){
        return obj.tagName ?true:false
    } 
    return objClass;
});

(function(c){var d=document,a='appendChild',i='styleSheet',s=d.createElement('style');s.type='text/css';d.getElementsByTagName('head')[0][a](s);s[i]?s[i].cssText=c:s[a](d.createTextNode(c));})
('@charset \"UTF-8\";\r\n\r\n.sn-radios > .chk-list { margin: 0; padding: 0;  font-size: 12px;}\r\n.sn-radios > .chk-list li { position: relative; display: inline-block; padding: 0 24px 12px 24px; list-style: none; }\r\n\r\n/* 全宽度竖向 */\r\n.sn-radios.all-width > .chk-list li { display: block; }\r\n\r\n.sn-radios > .chk-list li > div { position: absolute; top: -2px; left: 0;display: block; width: 20px; height: 20px; background: url(\'\') no-repeat; cursor: pointer; }\r\n.sn-radios > .chk-list li > div > input,.chk-list li > div > ins { position: absolute; left: 10%; top: -20%; display: block; width: 120%; height: 120%; margin: 0; padding: 0; background: #FFF; opacity: 0; filter: alpha(opacity=0); box-sizing: border-box; padding: 0; outline: none; }\r\n.sn-radios > .chk-list li > div, .chk-list li > div.static:hover { background-position: 0 0; }\r\n.sn-radios > .chk-list li > div.hover, .chk-list li > div:hover { background-position: -20px 0; }\r\n.sn-radios > .chk-list li > div.checked { background-position: -40px 0; }\r\n.sn-radios > .chk-list li > div.disabled { background-position: -60px 0; cursor: default; }\r\n.sn-radios > .chk-list li > div.checked.disabled { background-position: -80px 0; }\r\n.sn-radios > .chk-list li > label { cursor: pointer; color: #333; }\r\n/* 高清屏支持 */\r\n@media only screen and (-webkit-min-device-pixel-ratio: 1.5),\r\n       only screen and (-moz-min-device-pixel-ratio: 1.5),\r\n       only screen and (-o-min-device-pixel-ratio: 3/2),\r\n       only screen and (min-device-pixel-ratio: 1.5) {\r\n    .sn-radios > .chk-list li > div {\r\n        background-image: url(\'\');\r\n        -webkit-background-size: 100px 20px;\r\n        background-size: 100px 20px;\r\n    }\r\n}\r\n');
